<template>
  <div class="preson">
    <h1>中国</h1>
    <h2 ref="title2">北京</h2>
    <h3>鬼谷</h3>
    <button @click="showLog">点击输出</button>
  </div>
</template>

<script setup lang="ts" name="Preson">
  import {ref,defineExpose} from 'vue'
  // 数据
  let title2 = ref()
  let a = ref(),b = ref(),c = ref()
  // 方法
  function showLog(){
    console.log(title2.value)
  }
  defineExpose({a,b,c})
</script>

<style scoped>
.preson {
  background-color: skyblue;
  box-shadow: 0 0 10px 0;
  padding: 10px;
  border-radius: 10px;
}
</style>
